package com.neu.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neu.entity.SettleCategory;
import com.neu.mapper.SettleCategoryMapper;
import com.neu.service.SettleCategoryService;



@Service
public class SettleCategoryServiceImpl implements SettleCategoryService{
	@Autowired(required=true)
	private SettleCategoryMapper settleCategoryMapper;
	@Override
	public boolean addSettleCategory(SettleCategory settleCategory) {
		// TODO Auto-generated method stub
		int save = settleCategoryMapper.addSettleCategory(settleCategory);
		boolean flag = false;
		if(save>0) {
			flag = true;
		}
		return flag;
	}

	@Override
	public boolean deleteSettleCategory(int id) {
		// TODO Auto-generated method stub\
		int del = settleCategoryMapper.deleteSettleCategory(id);
		boolean flag = false;
		if(del>0) {
			flag = true;
		}
		return flag;
	}

	@Override
	public boolean updateSettleCategory(SettleCategory settleCategory) {
		// TODO Auto-generated method stub
		int upd = settleCategoryMapper.updateSettleCategory(settleCategory);
		boolean flag = false;
		if(upd>0) {
			flag = true;
		}
		return flag;
	}

	@Override
	public List<SettleCategory> pageSettleCategory(int page, int limit, String keyword) {
		// TODO Auto-generated method stub
		return settleCategoryMapper.pageSettleCategory(page, limit, keyword);
	}

	@Override
	public int pageSettleCategoryTotal(String keyword) {
		// TODO Auto-generated method stub
		return settleCategoryMapper.pageSettleCategoryTotal(keyword);
	}

}
